/**
	The Minerva Project, DAG Scheduling Tools
	Copyright (C) 2006 Florin Pop & Stefan Bucur

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 */
package ro.pub.cs.minerva.graph;

/**
 * @author Stefan Bucur
 *
 */
public class GraphSearchInfo<N extends GraphNode> {
	private N node;
	private int time;
	private N prevNode;
	
	private boolean stopRequested = false;
	
	public static final int COLOR_WHITE = 0;
	public static final int COLOR_GRAY = 1;
	public static final int COLOR_BLACK = 2;
	
	public GraphSearchInfo(N node, int time, N prevNode) {
		this.node = node;
		this.time = time;
		this.prevNode = prevNode;
	}
	
	public N getNode() {
		return node;
	}
	
	public int getTime() {
		return time;
	}
	
	public N getPrevNode() {
		return prevNode;
	}
	
	public int getStartTime(GraphNode node) {
		return node.startTime;
	}
	
	public int getEndTime(GraphNode node) {
		return node.endTime;
	}
	
	public int getCurrentColor(GraphNode node) {
		return node.crColor;
	}
	
	public boolean isStopRequested() {
		return stopRequested;
	}
	
	public void requestStop() {
		stopRequested = true;
	}
}
